from myspider.processor import BaseProcessor


class ImageProcessor(BaseProcessor):
    def process(self, item):
        img_response = self.spider.session.get(item['img_addr'])
        with open("./images/{}.jpg".format(item['img_name']), "wb") as fp:
            fp.write(img_response.content)
        return item
